<?php

namespace App\Models;

use Illuminate\Support\Collection;

class GoodsImages extends Model
{
    protected $table = 'yf_goods_images';
    protected $primaryKey = 'images_id';
    public $timestamps = false;
    protected $guarded = ['images_id'];

    public static function getGoodsImage(array $params) : Collection
    {
        return self::when(array_get($params, 'images_color_id'), function ($query) use ($params) {
                return $query->where('images_color_id', $params['images_color_id']);
            })
            ->get();
    }
}
